#include "heroplane.h"

HeroPlane::HeroPlane()
{
    //加载飞机图片
    m_Plane.load(HERO_PATH1);
    //初始化飞机坐标
    m_x=(GAME_WIDTH-m_Plane.width())*0.5;
    m_y=(GAME_HEIGHT-m_Plane.height());
    //初始化边框
    m_Rect.setWidth(m_Plane.width()-100);
    m_Rect.setHeight(m_Plane.height()-10);
    m_Rect.moveTo(m_x+50,m_y+5);
    //初始化伤害
    m_Hurt=BULLET1_HURT;

    //初始化血量
    m_Hero_Blood=HERO1_BLOOD;
    //初始化蓝
    m_HERO_Blue=HERO1_BLUE;
    //初始化护盾
    m_Shield_x=-100;
    m_Shield_y=-100;
    m_shield_free=1;
    m_Shield.load(":/rec.image/Defend_imag.png");
    m_Shield_rect.moveTo(m_Shield_x,m_Shield_y);

}
//设置战机位置
void HeroPlane::setPOsition(int x, int y)
{
    m_x=x;
    m_y=y;
    m_Rect.moveTo(m_x+50,m_y+5);
}
